﻿using System;
using System.Data;
using System.Text;
using System.Data.OracleClient;
using Maticsoft.DBUtility;//Please add references
namespace ORSIMS.DAL
{
	/// <summary>
	/// 数据访问类:IMAGE_METADATA
	/// </summary>
	public partial class IMAGE_METADATA
	{
		public IMAGE_METADATA()
		{}
		#region  BasicMethod



		/// <summary>
		/// 增加一条数据
		/// </summary>
		public bool Add(ORSIMS.Model.IMAGE_METADATA model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into IMAGE_METADATA(");
			strSql.Append("ID,TYPEID)");
			strSql.Append(" values (");
			strSql.Append(":ID,:TYPEID)");
			OracleParameter[] parameters = {
					new OracleParameter(":ID", OracleType.Number,10),
					new OracleParameter(":TYPEID", OracleType.VarChar,3)};
                    //new OracleParameter(":TASKID", OracleType.VarChar,5),
                    //new OracleParameter(":IMGID", OracleType.VarChar,32),
                    //new OracleParameter(":DATARESOURCE", OracleType.VarChar,20),
                    //new OracleParameter(":PLATFORMCARRIER", OracleType.VarChar,20),
                    //new OracleParameter(":SENSORNAME", OracleType.VarChar,20),
                    ////new OracleParameter(":IMGGENTIME", OracleType.DateTime),
                    //new OracleParameter(":PHOTOREGION", OracleType.VarChar,20),
                    //new OracleParameter(":UPPERLEFTLONG", OracleType.Number,10),
                    //new OracleParameter(":UPPERLEFTLAT", OracleType.Number,10),
                    //new OracleParameter(":LOWERRIGHTLONG", OracleType.Number,10),
                    //new OracleParameter(":LOWERRIGHTLAT", OracleType.Number,10),
                    //new OracleParameter(":SCALE", OracleType.Number,10),
                    //new OracleParameter(":RESOLUTION", OracleType.Number,3),
                    //new OracleParameter(":IMGSIZE", OracleType.VarChar,20),
                    //new OracleParameter(":PIXLSDEPTH", OracleType.Number,2),
                    //new OracleParameter(":COORDINATESYSTEM", OracleType.VarChar,20),
                    //new OracleParameter(":PROJECTION", OracleType.VarChar,50),
                    //new OracleParameter(":IMAGEFORMAT", OracleType.VarChar,10),
                    //new OracleParameter(":PRODUCTLEVEL", OracleType.VarChar,5),
                    ////new OracleParameter(":PREVIEWIMG", OracleType.Blob),
                    //new OracleParameter(":IMGFILENAME", OracleType.VarChar,50),
                    //new OracleParameter(":IMGFILEPATH", OracleType.VarChar,255),
                    //new OracleParameter(":IMGDISKINDEX", OracleType.VarChar,90),
                    //new OracleParameter(":USERID", OracleType.VarChar,20),
					//new OracleParameter(":METADATADATE", OracleType.DateTime),
					//new OracleParameter(":STATUS", OracleType.Number,1),
                    //new OracleParameter(":REMARK", OracleType.VarChar,200),
                    //new OracleParameter(":IMGFILESIZE", OracleType.VarChar,5)};
			parameters[0].Value = model.ID;
			parameters[1].Value = model.TYPEID;
            //parameters[2].Value = model.TASKID;
            //parameters[3].Value = model.IMGID;
            ////parameters[4].Value = model.DATARESOURCE;
            //parameters[4].Value = model.PLATFORMCARRIER;
            //parameters[5].Value = model.SENSORNAME;
            ////parameters[7].Value = model.IMGGENTIME;
            //parameters[6].Value = model.PHOTOREGION;
            //parameters[7].Value = model.UPPERLEFTLONG;
            //parameters[8].Value = model.UPPERLEFTLAT;
            //parameters[9].Value = model.LOWERRIGHTLONG;
            //parameters[10].Value = model.LOWERRIGHTLAT;
            //parameters[11].Value = model.SCALE;
            //parameters[12].Value = model.RESOLUTION;
            //parameters[13].Value = model.IMGSIZE;
            //parameters[14].Value = model.PIXLSDEPTH;
            //parameters[15].Value = model.COORDINATESYSTEM;
            //parameters[16].Value = model.PROJECTION;
            //parameters[17].Value = model.IMAGEFORMAT;
            //parameters[18].Value = model.PRODUCTLEVEL;
            ////parameters[21].Value = model.PREVIEWIMG;
            //parameters[19].Value = model.IMGFILENAME;
            //parameters[20].Value = model.IMGFILEPATH;
            //parameters[21].Value = model.IMGDISKINDEX;
            //parameters[22].Value = model.USERID;
			//parameters[26].Value = model.METADATADATE;
			//parameters[27].Value = model.STATUS;
            //parameters[28].Value = model.REMARK;
            //parameters[29].Value = model.IMGFILESIZE;

			int rows=DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	

	

		#endregion  BasicMethod
		#region  ExtensionMethod

		#endregion  ExtensionMethod
	}
}

